home *** CD-ROM | disk | FTP | other *** search
/ SGI Hot Mix 17 / Hot Mix 17.iso / HM17_SGI / research / examples / doc / plot04 < prev    next >
Text File  |  1997-07-08  |  883b  |  38 lines

  1. ; This batch file creates a plot used in Chapter 10, "Plotting",
  2. ; of _Using IDL_.
  3.  
  4. ; Define variables.
  5.  
  6. @plot01
  7.  
  8. ; Draw axes with no data, setting the data range.
  9.  
  10. PLOT, YEAR, CHINOOK, YRANGE = [MIN(SOCKEYE), MAX(CHINOOK)], /NODATA, $
  11.     TITLE='Chinook and Sockeye Populations', XTITLE='Year', $
  12.     YTITLE='Fish (thousands)'
  13.  
  14. ; Make a vector of x values for the polygon by duplicating the first
  15. ; and last points.
  16.  
  17. PXVAL = [YEAR(0), YEAR, YEAR(N1)]
  18.  
  19. ; Get y value along bottom x-axis.
  20.  
  21. MINVAL = !Y.CRANGE(0)    
  22.  
  23. ; Make a polygon by extending the edges of the math score down
  24. ; to the x-axis.
  25.  
  26. POLYFILL, PXVAL, [MINVAL, CHINOOK, MINVAL], $
  27.     COL = 0.75 * !D.N_COLORS    
  28.  
  29. ; Do the same with the verbal score.
  30.  
  31. POLYFILL, PXVAL, [MINVAL, SOCKEYE, MINVAL], $
  32.     COL = 0.50 * !D.N_COLORS
  33.  
  34. ; Label the polygons.
  35.  
  36. XYOUTS, 1968, 430, 'SOCKEYE', SIZE=2
  37. XYOUTS, 1968, 490, 'CHINOOK', SIZE=2 
  38.